package com.example.状态模式;

/**
 * 2. 加了速溶咖啡的状态
 */
public class InstantCoffeCupState implements State {
    private MakeCoffe makeCoffe;

    public InstantCoffeCupState(MakeCoffe makeCoffe) {
        this.makeCoffe = makeCoffe;
    }

    @Override
    public void takeCup() {
        System.out.println("杯子中已经加了速溶咖啡了, 不需要在拿一个了");
    }

    @Override
    public void addInstantCoffe() {
        System.out.println("杯子中已经加了速溶咖啡了, 不需要再放速溶咖啡了");
    }

    @Override
    public void addWater() {
        makeCoffe.state = makeCoffe.coffeOkState;
        System.out.println("往有速溶咖啡的杯子里, 加水");
    }

    @Override
    public void enjoyCoffe() {
        System.out.println("现在杯子中还没加水, 享受不了啊");
    }
}
